{% extends "bootstrap/base.html" %}

{% block title %}Flask_Sqlachemy_RESTfulAPI_Codegen{% endblock %}

{% block styles %}
    {{ super() }}
    <link rel="stylesheet" href="../static/css/global.css">
{% endblock %}

{% block content %}

    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title">Flask_Sqlachemy_RESTfulAPI_Codegen</h3>
        </div>
        <div class="panel-body">
            <h2> 已配置表信息 </h2>
            请确认配置表的信息，如果有错误请返回修改
        </div>
        <div class="panel-body container-body">
            <table class="table">
                <thead>
                <tr>
                    <th>表名</th>
                    <th>是否逻辑删除</th>
                    <th>加密字段</th>
                    <th>业务主键</th>
                    <th>业务主键生成规则</th>
                </tr>
                </thead>
                <tbody>

                {% for item in tabledata %}
                    {% if item.issave=='true' %}
                        <tr>
                            <td>{{ item.table }}</td>
                            <td>
                                {% if item.isdeleted=='' %}
                                    否
                                {% elif item.isdeleted=='true' %}
                                    是
                                {% endif %}
                            </td>
                            <td>
                                {% for itemencrypt in item.encrypt %}
                                    {{ itemencrypt }}
                                    {% if not loop.last %}
                                        ,
                                    {% endif %}
                                {% else %}
                                    /
                                {% endfor %}
                            </td>
                            <td>
                                {{ item.isbusinesskey }}
                                {% if item.isbusinesskey=='' %}
                                    /
                                {% endif %}
                            </td>
                            <td>
                                {{ item.businesskeyrule }}
                                {% if item.businesskeyrule=='' %}
                                    /
                                {% endif %}</td>
                        </tr>
                    {% endif %}
                {% endfor %}

                </tbody>
            </table>
        </div>

        <div class="panel-body btn-body">
            <button type="button" class="btn btn-primary" onclick="window.history.back()">
                <span class="glyphicon glyphicon-arrow-left"></span>
            </button>
            <form method="post">
                <button type="submit" class="btn btn-primary btn-next">开始生成</button>
            </form>
        </div>

        <div class="panel-footer">
        </div>
    </div>

{% endblock %}